<div class="change-Passowrd"> 
    <p class="validateTips"><strong>Change password:</strong></p>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">

        <tr>  <td><label for="password"><strong style="font-size:11px;">Password:</strong><span class="requre">*</span></label></td>
            <td>&nbsp;</td>
            <td><input type="password" name="UserChangePassword[password]" id="change_password" value="" class="text ui-widget-content ui-corner-all" />
                <div class="errorMessage2"></div></td>
        </tr>
        <tr>
            <td><label for="repassword"><strong style="font-size:11px;">Re-Type Password:</strong><span class="requre">*</span></label></td>
            <td>&nbsp;</td>
            <td><input type="password" name="repassword" id="change_repassword" value="" class="text ui-widget-content ui-corner-all" />
                <div class="errorMessage1"></div></td>
        </tr>
        <tr>
            <td></td>
            <td>&nbsp;</td>
            <td><input type="submit" name="submit" id="submit" value="Save" class="btn twoBtn" /></td>
        </tr>
    </table>

</div>
<style>
    .requre,.errorMessage1,.errorMessage2{color: red;}
</style>
<script>
    $("#submit").click(function(){        
        var password=$("#change_password").val();       
        var repassword=$("#change_repassword").val();
        if(password==''){
            $(".errorMessage2").text('Enter the password');
            return false;
        }
        else if(repassword==''){
            $(".errorMessage").hide();
            $(".errorMessage1").text('Enter the repassword');
            return false;
        }
        else if(password!=repassword){
            $(".errorMessage").hide();
            $(".errorMessage1").text('Password do not match retypepassword');
            return false;
        }
        else{
            $.post("<?php echo Controller::createUrl('profile/changepassword'); ?>", {password:password},
            function(result) {                
                $.fn.colorbox.close();
                $(".alert-success").show();return false;
            });
        }
    })
</script>